﻿using System;
class ExerciseSet
{

    public ExerciseSet(int Units,
                ExerciseInfo ExerciseInfo,
                double Time) {
        this.Units = Units;
        this.ExerciseInfo = ExerciseInfo;
        this.Time = new TimeOfDay(Time);
    }

    public int Units { get; private set; }

    public ExerciseInfo ExerciseInfo { get; private set; }

    public TimeOfDay Time { get; private set; }



    /* Boilerplate */

    public override string ToString() {

        string ret = string.Empty;

        ret += "Units = " + this.Units;
        ret += ", ";
        ret += "ExerciseInfo = " + this.ExerciseInfo;
        ret += ", ";
        ret += "Time = " + this.Time.ToString();

        ret = "{ExerciseSet: " + ret + "}";
        return ret;

    }


    public object this[string field] {
        get {
            if (field == "Units") return Units;
            if (field == "ExerciseInfo") return ExerciseInfo;
            if (field == "Time") return Time;
            throw new ArgumentException();
        }
        set {
            if (field == "Units") { Units = (int)value; return; }
            if (field == "ExerciseInfo") { ExerciseInfo = (ExerciseInfo)value; return; }
            if (field == "Time") { Time = (TimeOfDay)value; return; }
            throw new ArgumentException();
        }
    }

}
